Kwaito. A computational analysis of the South African (sub)genre


Kwaito

This computational analysis explores the musical features of “Kwaito”, a South African music genre that emerged in Johannesburg during the 1990s. Kwaito is labeled by some as ‘South African Hip-Hop’. Others say it’s more like slowed down House music. Some people argue it is “just Kwaito, and you can’t compare it to anything”. The exact roots have remained a guess for most until today. In this musicological analysis I’ll try to reveal some of Kwaito’s mystery, by looking at the Spotify features of typical Kwaito music. These will then be compared to other related styles of music that came up around that time.

In the following tabs you’ll find a data analysis of Spotify’s track level features such as tempo, valence and danceability. We’ll also inspect the chroma features of classic Kwaito songs and touch upon the loudness and timbre features and look in to the structural segments, beats and rhythm. Combining different forms of musical analysis we hope to gain insights in the characteristics of the true Kwaito sound. Through broad range of analytic scopes we also hope to discover to what and to what extend Kwaito links to other musical styles, like the two already mentioned. A third objective for this project is to use the process to evaluate and test the possibilities and limitations of the Spotify API.

A brief history of Kwaito


A brief history

The sound of Kwaito developed in the late 1980’s in the townships of South Africa and came to be the soundtrack for a youth culture movement. With it’s peak in the 90’s the Kwaito sound also started to spread globally. From then on, collectors and diggers across the globe started discovering the genre and finding its endless source of inspiration. As they do, Kwaito is still fuelling dance floors around the world to this day. The broad and varied form of Kwaito makes it very hard to encapsulate completely as a genre. Kwaito fuses elements of traditional South African music with other genres throughout the African diaspora.

Kwaito was originally heard as simply slowed-down house music. The repetitive four on the floor beat and swung high hat patterns are some of the characteristics that closely link to the classic structure of house music. What’s for sure is that it holds the power to make dance floors shake. In general the sound is known for it’s danceability, making it’s way to the international clubs and festival circuit. Others recognise a strong hip-hop influence. The late ‘80s the township slang of South Africa has formed the backbone of Kwaito. Reflecting on social changes and cavernous cracks in South-African society, Kwaito is labeled by some as ’South African Hip-Hop’. It’s influence becomes evident as a number of Kwaito songs have clear references to American hip-hop forms, paying homage to artists like Snoop Dogg and Grandmaster Flash.

Defining Kwaito as a musical genre seems to be a struggling process still today, making it a fascinating and compelling subject of research. In this portfolio we’ll explore the musical boundaries of the South African (sub)genre and try to reveal it’s relation to more classical styles like Hip-Hop and House. Finally, in our search of the true Kwaito sound, we’ll take the opportunity to test and evaluate the possibilities and limitations of the Spotify API.

Working with Spotify API


The Spotify API offers a variety of track-level features for all music on Spotify. Because of the enormous amount of data that is accessible through the API, it is important to consider only the most relevant options for the study. The plot shows a number of track-level features from the three playlists, each representing their own musical style. Respectively the genres Hip-Hop, Kwaito and House are compared. All three playlists contain a selection of 50 tracks that are supposed to be representative for the genre. Of course we should keep in mind that a musical genre is a complex social construct that has shifting boundaries. For this study I chose playlists that have got a reasonable ‘following’ on Spotify. This choice is deliberate, building on Sociological theories that argue musical genre in itself, is a social construct which exists by the legitimacy of people, and grows more solid as it gets more followers and eventually consolidates over time. The playlists consists of a relatively clearly demarcated selection of tracks that positions itself within the boundaries of the genre.

For this study I chose the following track-level features:

Speechiness: this detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like tracks.

Tempo. This is the overall estimated tempo of a track in beats per minute (bpm). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration. The speechiness feature covers the x-axes and the tempo feature the y-axes. The ‘tempo’ feature, seemed to be the best option in my case. Tempo in general is a strong feature because it carries a high amount of deterministic value. The tempo of a song has proved to be an essential factor in the way people give meaning to music and how they perceive it, consciously as well as unconsciously. Tempo can also be seen as representative because it can easily be used as tool to distinguish a genre from others in an easy, quantifiable manner that is widely known and used.

Danceability. The value for danceability is shown by lightness of color, lighter being valued as more danceable. This seemed like a relevant feature, since dance culture is closely linked to the cultural norms of the three genres we are focusing on.

Hip-Hop, House or Kwaito?


Looking at the distribution for the y-axes we see a clear tempo difference between the three genres. The selection house tracks ranges anywhere between 120-130 bpm, which is typical for it’s style. The selection Kwaito has a little bit of a broader range, but the greater part is positioned in the range of 100-110. This seems in line with the associations we discussed earlier, in which Kwaito was described as “slowed down house music”.

When we look at speechiness we are also seeing some variation between the genres. Hip hop tracks are valued most speechiness, next Kwaito, and coming in last House. All of the tracks from every genre are valued <0.30. According to the Spotify description of speechiness you could therefore only say ‘they are likely to represent music and other non-speech-like tracks’. I was expecting to see more speechiness in the kwaito tracks, as Kwaito is often being described as “the South African Hip-Hop” and it is especially known for spoken lyrics and talk overs. Kwaito was eminently known as a way for people to get their voice heard, like a catalyst used for political purposes. This even got to the point Kwaito got banned for it by the South African government. However the speechiness feature doesn’t really give us a real clue about these aspects of Kwaito.

As for the danceability feature you can see far more value in Hip Hop and Kwaito tracks than in House tracks. This is remarkable because House music has a strong club culture. House as a genre I would associate most with dancing as House tracks are usually created for this purpose. Usually in my experience if there is House music played, regardless of where or the occasion, there is dancing. When Hip-Hop is played for exmample, again based on my own experience, this is not as often the case.

About tempo!


Tempograms provide insight in how tempo evolves during a musical piece. The x-axis contains the song duration and the y-axis contains the measured tempo in beats per minutes. Brighter areas indicate larger amounts of energy.

I was curious if Kwaito songs ar produced live or that it is fully digital and therefor synchronized to a fixed grid.

The tempogram is of a Kwaito song from the playlist. We are seeing a steady line that doesn’t really change over time. This would suggest that the tempo remains stable over the course of the song. This indicates Kwaito is digitally produced rather than recorded with live instruments. To be sure I did a tempogram for a few other tracks and this seemed the case for most.

The tempo in bpm in this tempogram seems to be around 440, which is obviously very unlikely. Sometimes the tempo of a song is multiplied. With downtempo songs like soul or slow Hip-Hop this is often the case. It shows why beat analysis could be problematic. A fix for this could be to set a range in bpm of which you are sure the track is in, for example 50-200 bpm. I have seen programs, mostly DJ software, that actually are pretty good at BPM estimation. I guess this is one of the things that can therefore be improved in the Spotify API.

Dynamic Time Warping, B.I.G vs Kwaito version


One of the things you can do with Spotify API is visual Dynamic Time Warping. By using Dynamic Time Warping, you are able to compare the pitches of two versions of a track in a single visualization. You should be able to line up a cover version of a song with the original track, or even another cover version of the song. When two versions have the same pitch but are performed by different artist you’ll see a diagonal line in the visualization.

To see if Kwaito differs a lot from Hip-Hop we are doing a test case with a classic Hip-Hop song: B.I.G.- Big Poppa, and a Kwaito version that uses the same melody: Sandy B - Student Night.

As you can see both tracks are very different from each other which could suggest that the Kwaito cover is a lot different from a Hip-Hop song. However, we can’t really generalize this to say all Kwaito songs differ a lot from Hip-Hop tracks.

The fact that two tracks using the same melody sound so different you could see as an indication of their independence to each other. On the other hand you could see the use of a classic Hip-Hop sample as a Kwaito song as an indication that there is some sort of linkage between the genres.

Self-Similarity: The chroma- and timbre features of a ’Classic" Kwaito track


To get some insights in the similarities and differences between Hip Hop, Kwaito and House we analyze two self-similarity matrices for a single track from each genre individually. Both the chroma and timbre matrices could be useful to understand the structure of a song.

First: a track from the Kwaito playlist

The timbre similarity matrix shows us some clear patterns. The matrix was able to pick up some of the presentations of the chorus. It looks like the Kwaito track follows some sort of pattern where the song starts with some sort of chorus, followed by a verse, chorus, verse etc.

The duration of the Kwaito song is 350 seconds, which is pretty long but not uncommon for Kwaito music. Compared to most Hip-Hop tracks however this is relatively long.

Self-Similarity: The chroma- and timbre features of a ’Classic" House track


The House track ‘Big Fun’, from Inner City is a classic. Looking at the matrix we can see repetition most of all. After 100 sec the rather famous break comes in. The synthesizers in the track drop out completely for about 20 seconds, after this little interlude the synths come back hard and the party can start again. This break can be seen in both the chroma- and the timbre matrix. In contrast to the Kwaito Matrix we don’t really see a chorus or verse in this one. The duration of the House track is just over 200 seconds, which is not too long for a House track. Often tracks in this genre have a repetitive intro and outro which is used to mix the track with another. I expect there to be a longer version as well that is played more in clubs.

Self-Similarity: The chroma- and timbre features of a ’Classic" Hip Hop track


We are looking at a ‘Classic’ Hip Hop track. The track goes by the title ‘What’s the Difference’ and comes from the artist Dr. Dre. The matrices are able to pick up some of pattern, including the presentations of the chorus. It seems Hip-Hop song follows a similar pattern as the Kwaito song, with some sort of chorus, followed by a verse, chorus etc.

The duration of ‘What’s the Difference’ is nearly 250 seconds. This is pretty long for Hip-Hop, but not uncommon. Hip-Hop tracks from around the ‘Dr Dre era’ also were a bit longer compared to Hip-Hop nowadays.

Confusion Matrix of Hip-Hop, House and Kwaito

               Truth
Prediction      CLASSIC HOUSE HIP HOP SA KWAITO
  CLASSIC HOUSE            40       1         7
  HIP HOP                   2      37        11
  SA KWAITO                 8      12        32

# A tibble: 3 x 3
  class         precision recall
  <fct>             <dbl>  <dbl>
1 CLASSIC HOUSE     0.833   0.8 
2 HIP HOP           0.74    0.74
3 SA KWAITO         0.615   0.64
# A tibble: 3 x 3
  class         precision recall
  <fct>             <dbl>  <dbl>
1 CLASSIC HOUSE     0.870  0.8  
2 HIP HOP           0.672  0.82 
3 SA KWAITO         0.767  0.660

This classification algorithm is going to make predictions after the training. For me to be able to make a difference between Kwaito, House and Hip-Hop, I need to know for every track what it actually is. The classification algorithm is going to make a prediction for a new track to whether the track is Kwaito, House and Hip-Hop. Then, the question remains: how good is my classifier? To get the most accurate picture of what my classifier is doing I actually want to look at these per class. So if I want to compare Kwaito, House and Hip-Hop, I want to know for Hip-Hop what is my recall and what is my precision, for House what is my recall what is my precision etc. What do these mean? Well there are all based on the confusion matrix. This matrix is basically breaking things down into 4 possibilities. So you look at the so called ground truth class, what is it really? The difference between precision and recall is which mistakes you look at. These numbers are not the same. If you have very good recall, often the precision is not so great. Often if you have good precision, recall not so good. So, precision is when you look only at just the predictions, so of everything my classifier said was Hip Hop, how many of those really are Hip Hop? Recall is when you flip precision around. If I look at everything in my corpus that actually is Hip Hop, and how many of those did the classifier find?

Now, we evaluate. Looking at the table we can see the classifier did a pretty good job. It was pretty accurate in predicting the songs genre. This would suggest all three genres, looking at their Spotify features, are not so similar after all. This is interesting in light of our research question, where Kwaito is often described as the fusion output of House and Hip-Hop.

Conclusion

Defining Kwaito as a genre has not been proved easy. It was however a very interesting case study, showing all the ways of analyzing music and the variety of interpretations one can have of a musical genre. In this portfolio we explored the musical boundaries of Kwaito and hoped to discover more about it’s relation to other genres like Hip-Hop and House. Where Kwaito is labeled by some as ‘South African Hip-Hop’ and by others as a ‘slowed down version of House’, I would agree with people saying it is “just Kwaito, and you can’t compare it to anything!”.

The Spotify API provided us with varies ways to show Kwaito’s uniqueness. Looking at the tempo feature we could see Kwaito has it’s own range in BPM, significantly different from House and Hip-Hop. The comparison of the Kwaito version of a classic Hip-Hop track also showed us the originality of Kwaito. Most convincing to me however was the classification tool. We could see the classifier did a very good job in predicting the songs genre. This would suggest all three genres, looking at their Spotify features, are unique in it’s kind.

Finally, we tried to use this portfolio for the evaluation of the Spotify API. We took the opportunity to test and evaluate the possibilities and limitations of the Spotify API. First of all I want to say it is a very fun tool to use and